package com.ruoyi.goods.api.factory;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.goods.api.ReSpecificationService;
import com.ruoyi.goods.api.RemoteGoodsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author:Jiang
 * @Date: 2023/08/09/ 17:19
 **/
@Component
public class ReSpecificationFallbackFactory implements FallbackFactory<ReSpecificationService> {
    private static final Logger log = LoggerFactory.getLogger(ReSpecificationFallbackFactory.class);

    @Override
    public ReSpecificationService create(Throwable cause) {
        log.error("商品规格调用失败:{}", cause.getMessage());
        return new ReSpecificationService() {

            @Override
            public AjaxResult getInfo(Long id) {
                return null;
            }
        };
    }
}
